
#include <apvp.pb.h>
#include "PlatformProperty.h"

TRANSMIT_READ_PROPERTY(PA_VP_Version,std::string) {
    builder.area(VehicleArea::GLOBAL)
        .initValue([](){
                return "";
        })

        .withStatusBySignals([](const PropertyStatus lastStatus){
                PropertyStatus currentStatus = PropertyStatus::Active;
                auto paData=SIGNAL.getPA_VP_Version();
                if(paData.availability == toInt(sdb::AvailabilitySts::Active)){
                    currentStatus = PropertyStatus::Active;
                }else if(paData.availability == toInt(sdb::AvailabilitySts::NotActive)){
                    currentStatus = PropertyStatus::NotActive;
                }else if(paData.availability == toInt(sdb::AvailabilitySts::NotAvailable)){
                    currentStatus = PropertyStatus::NotAvailable;
                }else if(paData.availability == toInt(sdb::AvailabilitySts::Error)){
                    currentStatus = PropertyStatus::Error;
                }
                return currentStatus;
        },ecarx::transfer::PASignal::PA_VP_Version)

        .withValueBySignals([]([[maybe_unused]] std::string lastValue){

            auto paData=SIGNAL.getPA_VP_Version();
            return std::string(reinterpret_cast<char const *>(paData.data));

        },ecarx::transfer::PASignal::PA_VP_Version);
}
